<template>
  <div>
    <Appheader :parentToChild="ymname"></Appheader>
    <div class="content" v-loading="loading">
      <div class="title">{{info.title}}</div>
      <div class="creattime">{{info.createUser}}&nbsp;&nbsp;{{info.createTime}}</div>
      <img :src="photo" alt class="phott" />
      <div class="zixun_content" v-html="info.details"></div>
    </div>
    <Appfooter></Appfooter>
  </div>
</template>

<script>
import Appheader from "../header";
import Appfooter from "../footer";
import { ykSchoolNewinfo } from "../../api/index";
export default {
  props: {},
  data() {
    return {
      ymname: "",
      id: "",
      loading: true,
      info: "",
      photo: ""
    };
  },
  computed: {},
  created() {},
  mounted() {
    if (this.$route.params.id) {
      this.id =
        this.$route.params.id || sessionStorage.getItem("school_listdetail_id");
      sessionStorage.setItem("school_listdetail_id", this.id);
      this.post();
    } else if (this.$route.params.photo) {
      this.photo =
        this.$route.params.photo ||
        sessionStorage.getItem("school_listdetail_photo");
      sessionStorage.setItem("school_listdetail_photo", this.photo);
      this.ymname = "首页";
      this.loading = false;
    }
  },
  watch: {},
  methods: {
    post() {
      let msg = {
        id: this.id
      };
      ykSchoolNewinfo(this.qs(msg))
        .then(res => {
          // console.log(res);
          this.info = res.data.YkSchoolNew;
          this.ymname = "高校招生简章";
          this.loading = false;
        })
        .catch(e => {});
    }
  },
  components: { Appheader, Appfooter }
};
</script>

<style scoped>
.content {
  width: 1171px;
  margin: 0 auto;
}
.title {
  margin-top: 27px;
  font-size: 24px;
  font-weight: bold;
  color: rgba(51, 51, 51, 1);
  margin-bottom: 10px;
  text-align: center;
}
.creattime {
  font-size: 14px;
  text-align: center;
  font-weight: 400;
  color: rgba(51, 51, 51, 1);
}
.zixun_content,
.zixun_content p,
.zixun_content div {
  margin-top: 18px;
  font-size: 14px;
  font-weight: 400;
  color: rgba(51, 51, 51, 1);
  line-height: 27px;
}
.zixun_content img {
  width: 400px;
  height: auto;
  margin: 0 auto;
  margin-top: 10px;
}
.phott {
  width: 400px;
  height: auto;
  margin: 0 auto;
  margin-top: 10px;
}
</style>
